home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_13_07 / guthrie / aqmsg.hpp < prev    next >
C/C++ Source or Header  |  1994-10-08  |  2KB  |  57 lines

  1. //========================= AQMSG.HPP ===================================
  2. //  AutoQueueMessage class is derived from AutoQueue by the user.
  3. //  R. Scott Guthrie - Original Code Creation
  4. //=======================================================================
  5. #ifndef __AQMSG_HPP
  6. #define __AQMSG_HPP
  7. #include <cstring.h>         // Borland 4.02 string class definition.
  8. #include "AUTOQ.HPP"         // Include base class definitions.
  9.  
  10. // ===== AutoQueueMessage Class   (Derived from AutoQueue) =====
  11. class AutoQueueMessage : public AutoQueue
  12. {
  13.   public:
  14.     // ----- Constructors / Destructor -----
  15.     // Constructor used to create a Non-Linked AutoQueueMessage entry.
  16.     // Data Items 'Number_' and 'Text_' are initialized.
  17.     AutoQueueMessage(int Number, string& Text) : AutoQueue(),
  18.                      Number_(Number), Text_(Text) { }
  19.  
  20.     // Constructor used to create the AutoQueueMessage entry.
  21.     // Data Items 'Number_' and 'Text_' are initialized.
  22.     AutoQueueMessage(AutoQueueMessage** QHead, int Number, string& Text):
  23.           AutoQueue((AutoQueue**)QHead), Number_(Number), Text_(Text) { }
  24.  
  25.     ~AutoQueueMessage() { }
  26.  
  27.     // Specialized copy type constructor.
  28.     // Copies an AutoQueueMessage instance to a stand alone instance.
  29.     // Source can be a stand alone instance or a member of a list.
  30.     AutoQueueMessage(const AutoQueueMessage* Source):
  31.           AutoQueue(), Number_(Source->Number_), Text_(Source->Text_) { }
  32.  
  33.     // Specialized copy type constructor.
  34.     // Copies an AutoQueueMessage instance to a specified list.
  35.     // Source can be a stand alone instance or a member of a list.
  36.     AutoQueueMessage(AutoQueueMessage** QHead, const AutoQueueMessage* Source):
  37.           AutoQueue((AutoQueue**)QHead), Number_(Source->Number_),
  38.                      Text_(Source->Text_) { }
  39.  
  40.     void List();    // List all elements in the list.
  41.  
  42.     // Find an instance in the list that matches the integer 'Match'.
  43.     AutoQueueMessage* FindByNumber(const int Match);
  44.  
  45.   private:
  46.     // Prohibit these default methods.   (Do not define these functions)
  47.     AutoQueueMessage();
  48.     AutoQueueMessage(const AutoQueueMessage& rhs);
  49.     AutoQueueMessage& operator=(const AutoQueueMessage& rhs);
  50.  
  51.   protected:
  52.     int Number_;      // AutoQueueMessage data value.
  53.     string Text_;     // AutoQueueMessage data value.
  54. };
  55. #endif
  56. // end file AQMSG.HPP
  57.